import request from '@/utils/request'

export function login(obj) {
  return request({
    url: '/login',
    method: 'post',
    params: obj
  })
}

export function getInfo(token) {
  return request({
    url: '/sys/getUserInfo?token=' + token,
    method: 'get'
  })
}

export function getUsers() {
  return request({
    url: '/sys/getUsers',
    method: 'get'
  })
}

// 添加用户
export function addUser(obj) {
  return request({
    url: '/sys/addUser',
    method: 'post',
    data: obj,
    contentType: 'multipart/form-data'
  })
}

// 删除用户
export function deleteUser(obj) {
  return request({
    url: '/sys/deleteUser',
    method: 'delete',
    params: obj
  })
}

// 更新用户
export function updateUser(obj) {
  return request({
    url: '/sys/updateUser',
    method: 'put',
    data: obj
  })
}

// 编辑权限
export function updateAuthority(obj) {
  return request({
    url: '/sys/updateAuthority',
    method: 'post',
    data: obj
  })
}

